package com.example.demo.exception;

/**
 * @author LF
 * @date 2021/4/21 - 13:44
 */
public enum CommonEnum implements BaseErrorInfoInterface{
    // 数据操作错误定义
    SUCCESS("200", "成功!"),
    BODY_NOT_MATCH("400","请求的数据格式不符!"),
    SIGNATURE_NOT_MATCH("401","请求的数字签名不匹配!"),
    NOT_FOUND("404", "未找到该资源!"),
    TIME_OUT("408","服务器等候请求时发生超时!"),
    REQUEST_BIG("413","请求体过大!"),
    INTERNAL_SERVER_ERROR("500", "服务器内部错误!"),
    SERVER_BUSY("503","服务器正忙，请稍后再试!")
    ;

    private final String code;
    private final String msg;
    CommonEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String resultCode() {
        return code;
    }

    @Override
    public String resultMsg() {
        return msg;
    }
}
